﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// DinhMucThu Repository. Good example of CRUD operations.
    ///// </summary>
    public class DinhMucThuRepository : IDinhMucThuRepository
    {
        private static readonly IDinhMucThuDao _dinhMucThu = DataAccess.DinhMucThuDao;
        public List<DinhMucThu> GetList()
        {
            return _dinhMucThu.GetDinhMucThu().ToList();
        }

        public DinhMucThu Get(string id)
        {
            return _dinhMucThu.GetDinhMucThuByID(id);
        }

        public void Insert(DinhMucThu t)
        {
            _dinhMucThu.InsertDinhMucThu(t);
        }

        public void Update(DinhMucThu t)
        {
            _dinhMucThu.UpdateDinhMucThu(t);
        }

        public void Delete(DinhMucThu t)
        {
            _dinhMucThu.DeleteDinhMucThu(t);
        }

        public List<DinhMucThu> GetDinhMucThuBySchoolId(int schoolId)
        {
         return  _dinhMucThu.GetDinhMucThuBySchoolId(schoolId).ToList();
        }


        public List<DinhMucThu> GetDinhMucThuBySchoolIdAndKhoi(int schoolId, string blockId)
        {
            return _dinhMucThu.GetDinhMucThuBySchoolIdAndKhoi(schoolId,blockId).ToList();
        }
    }
}